
export default class UserConfigTs {
    public static soundOn : boolean = false
    public static vibrateOn : boolean = false

    public static loadUserConfig(){
        let soundsOn = cc.sys.localStorage.getItem("user_setting_music_on")
        let vibrationOn = cc.sys.localStorage.getItem("user_setting_vibration_on")
        this.soundOn = soundsOn
        this.vibrateOn = vibrationOn


        if(!soundsOn || (soundsOn != cc.gg.enumConfig.SETTING.ON && soundsOn != cc.gg.enumConfig.SETTING.OFF)){
            this.soundOn = true
        }else {
            this.soundOn = <boolean>parseInt(soundsOn)
        }

        if(!vibrationOn || (vibrationOn != cc.gg.enumConfig.SETTING.ON && vibrationOn != cc.gg.enumConfig.SETTING.OFF)){
            this.vibrateOn = true
        }else {
            this.vibrateOn = <boolean>parseInt(vibrationOn)
        }
    }
}
